<?php
use yii\helpers\Html;
 ?>
 <div class="weui_tab goodsDetail">

    <div class="weui_navbar topFixed">
      <a href="<?php echo Yii::$app->request->getReferrer();?>" style="color:black;">
        <i class="iconfont icon-return"></i>
      </a>
      <span class="navTt">商品详情</span>
      <a href="/" style="color:black;">
        <i class="iconfont icon-home"></i>
      </a>
    </div>

    <div class="weui_tab_bd">

      <div class="swiper-container">
        <div class="swiper-wrapper">
          <div class="swiper-slide"><img src="<?= Html::encode($product->img_url)?>" alt=""></div>
          <?php foreach ($product_img as $key => $value): ?>
          	 <div class="swiper-slide"><img src="<?= Html::encode($value->img_url)?>" alt=""></div>
          <?php endforeach ?>
         
     <!--    g  <div class="swiper-slide"><img src="//gqianniu.alicdn.com/bao/uploaded/i4//tfscom/i1/TB1n3rZHFXXXXX9XFXXXXXXXXXX_!!0-item_pic.jpg_320x320q60.jpg" alt=""></div> -->

        </div>
        <div class="swiper-pagination"></div>
      </div>

      <div class="goodsInf content-pad">
        <p class="autoHeight">
        <span class="name left"><?= Html::encode($product->name)?></span>
          <?php if ($brand): ?>
            <!-- <a href="/product/index/?bid=<?= $brand->id?>"> -->
              <span class="tag right"><?= Html::encode($brand->name)?></span>
            <!-- </a> -->
          <?php endif ?>
        </p>
        <p>
          <span class="price">
            <em class="symbol1">￥</em><?= Html::encode($product->product_price)?>
            <em class="symbol2">/<?=Html::encode($product->price_unit)?></em>
          </span>
        </p>
        <p>
          <span class="guige">规格：<?=Html::encode($product->spec)?></span>
          <span class="lowerCount right">已售<?=Html::encode($order?$order:'0'.$product->price_unit)?></span>
        </p>
      </div>

      <div class="details">
        <h1 class="detailTt"><span class="txt">详情</span></h1>
        <div class="content-pad">
        <?= \yii\helpers\HtmlPurifier::process(strip_tags($product->des,'<p><br><img>'))?>
       </div>
      </div>

      <div class="footbar">
        <a href="tel:<?= $this->params['w_config']['contact_tel'] ?>" class="weui_btn weui_btn_primary">我要订购</a>
      </div>

    </div>


  </div>
  <script>
    $(function(){
      $(".swiper-container").swiper({
        loop: false,
        autoplay: 6000,
        pagination : '.swiper-pagination',
        paginationType : 'progress',
      })

      $('<div>',{
        'style': 'width: 40px;height: 40px;-webkit-border-radius: 50%;-moz-border-radius: 50%;border-radius: 50%;background: rgba(0,0,0,0.7);'+
        'position: fixed;bottom: 60px;right: 15px;text-align: center;z-index: 100',
        'id': 'fixTotop'
      }).html('<img src="http://static.tianpinwang.com.cn/v1/mobile/images/fixedTotop.png" style="margin-top: 8px;width: 38%;"/>').appendTo("body");

      $('#fixTotop').click(function(){
        $('html,body').animate({scrollTop: 0},100);
      })

    })
  </script>